home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / qemm.80c / technote.qip / BUS-MAST.TEC next >
Text File  |  1995-11-04  |  16KB  |  305 lines

  1.  
  2.             Using SCSI and Bus-Mastering Devices
  3.  
  4.  Quarterdeck Technical Note #121         Filename: BUS-MAST.TEC
  5.  by Quarterdeck Technical Support      CompuServe: BUSMAS.TEC
  6.  Last revised: 3/28/95                   Category: HW
  7.  
  8.  Subject: This note provides troubleshooting tips for users of
  9.           bus-mastering (typically SCSI) hard drives, and explains
  10.           bus-mastering technology in general for those who are
  11.           interested.
  12.  
  13.  Note: All references to 386 computers or to the 80386 processor,
  14.  unless otherwise stated, refer to 386 and higher processors.
  15.  
  16.  This note is divided into two parts -- a troubleshooting section
  17.  for those who believe that they are having problems with QEMM and
  18.  a SCSI hard drive, and an informational section on bus-mastering
  19.  issues.
  20.  
  21.  Refer to the troubleshooting section of the QEMM manual, or in the
  22.  technical note QEMM GENERAL TROUBLESHOOTING (TROUBLE.TEC) for
  23.  instructions on how to boot your machine without QEMM.
  24.  
  25.  1) If your machine locks immediately after posting the banner for
  26.     QEMM386, check to see if the DB=2 parameter is on the
  27.     QEMM386.SYS line in CONFIG.SYS. If this parameter is not
  28.     present, add it. If your machine now works, you're done, and
  29.     you may read the information section below. If your machine
  30.     still fails, continue with Step 2.
  31.  
  32.  2) Add the parameter VDS:N to the QEMM line, and reboot. If this
  33.     solves your problem, proceed to Step 3.
  34.  
  35.  3) Remove VDS:N parmeter (if one is present) from the QEMM line,
  36.     and immediately before the QEMM386.SYS place the line
  37.  
  38.     DEVICE=C:\QEMM\FIXINT13.SYS /STACKSIZE=384
  39.  
  40.     FIXINT13.SYS is in the QEMM directory.  It is also
  41.     available on the Quarterdeck BBS at (310) 309-3227. If this
  42.     solves your problem, you're done. If this does not solve your
  43.     problem (but the VDS parameter did), replace it. In either
  44.     case, you may now choose to read the information section below.
  45.  
  46.  Q. What is a bus-mastering device?
  47.  
  48.  A. Bus-mastering devices are peripherals, typically hard drives,
  49.     that do their own direct memory addressing (DMA) without going
  50.     through the machine's Central Processing Unit (CPU) or its DMA
  51.     controller. The most common bus-mastering devices are SCSI hard
  52.     disk controllers, but other types of devices can be
  53.     bus-mastering as well. Bus-mastering ESDI disk controllers and
  54.     video cards do exist, and an increasing number of bus-mastering
  55.     network cards are available as well. While bus-mastering
  56.     devices are high-performance devices and quite often found on
  57.     386 and higher systems, they are, unfortunately, by design
  58.     incompatible with one of the most common operating modes of the
  59.     80386 processor--the Virtual 86 mode.
  60.  
  61.     Specifically, the problem is that the device puts data into
  62.     absolute memory addresses and assumes that the contents of
  63.     those memory addresses will always remain constant. However, on
  64.     a 386 processor in Virtual 86 mode, this is often an incorrect
  65.     assumption. When a 386 memory manager such as QEMM, or a 386
  66.     operating environment such as DESQview 386 or Microsoft Windows
  67.     Enhanced Mode is used, it typically associates physical memory
  68.     with linear or "logical" addresses. QEMM does this, for
  69.     instance, to make High RAM appear at addresses between 640K and
  70.     1MB. When a bus-mastering device tries to access data in
  71.     memory, it presumes that physical and logical addresses are the
  72.     same. In Virtual 86 mode, a given memory address can, at any
  73.     moment, contain code or data from various regions of physical
  74.     memory.
  75.  
  76.     If you are using a bus-mastering device on a 386 that is in
  77.     Virtual 86 mode and memory paging is occurring (when QEMM is
  78.     providing High RAM; when QEMM is providing expanded memory;
  79.     when DESQview 386 or Microsoft Windows is switching from one
  80.     virtual machine to another), your machine will probably hang
  81.     when you use the bus-mastering device, unless certain
  82.     precautions are taken.
  83.  
  84.     Quarterdeck first became aware of the problem from customers
  85.     who had bus-mastering SCSI hard disk controllers. Users
  86.     reported that they could boot their machines and start up
  87.     DESQview. As long as they ran only one application, their
  88.     system ran fine. As soon as they opened a second application,
  89.     the system would hang. The problem was also seen by users who
  90.     were not using DESQview, but who were using the LOADHI feature
  91.     of QEMM. In both cases, the hang would occur because the disk
  92.     controller assumed that memory really existed at the address
  93.     that it was accessing. In theory, this could have caused data
  94.     corruption, but in reality it never did. The memory corruption
  95.     was typically so extensive that the systems simply hung as soon
  96.     as a change in the memory map occurred. Other 386 memory
  97.     managers exhibited the same symptoms, as did Windows version
  98.     3.x when run in Enhanced Mode. QEMM solved the problem in its
  99.     own code, but this solution was not adopted by Windows when it
  100.     entered Enhanced Mode (see the reference to SMARTDRV in item 4
  101.     below).
  102.  
  103.  Q. What is the best approach to running bus-mastering devices?
  104.  
  105.  A. There are several possible solutions:
  106.  
  107.  1) THE BEST SOLUTION: Contact the maker of your bus-mastering
  108.     device and see whether the manufacturer supports the VDS
  109.     (Virtual DMA Services) specification. VDS is now an
  110.     industry-wide specification supported by IBM, Microsoft and
  111.     Quarterdeck, as well as many other hardware and software
  112.     suppliers. VDS, either provided in the device's ROM or as a
  113.     device driver, allows a bus-mastering device to find the real
  114.     physical address of its data when the processor is in Virtual
  115.     86 mode. QEMM versions 5.00 and later support the VDS
  116.     specification. A VDS driver provides the best solution to this
  117.     problem in terms of reliability, speed and memory efficiency. A
  118.     VDS driver may be loaded into High RAM if it appears in the
  119.     CONFIG.SYS file after the QEMM386.SYS line, but you may need to
  120.     manually add a DB=2 parameter to the QEMM386.SYS device line to
  121.     accomplish this if you are not using QEMM 7.5 or later; see
  122.     section 6 below.
  123.  
  124.  2) Make sure you're using QEMM version 7.5 or later. QEMM now
  125.     automatically creates a buffer when it detects an addressing
  126.     problem with a bus-mastering hard drive controller, and this
  127.     buffer's support continues into Microsoft Windows.
  128.  
  129.  3) Similarly, the drivers of many bus-mastering hard disks have
  130.     proprietary (that is, non-VDS) buffering options. The best
  131.     course in this case is to check the documentation for your disk
  132.     controller to see if the driver has a parameter to set up
  133.     buffering for disk operations. Some drivers will also document
  134.     parameters that are specific to 386 operations. For example,
  135.     the early Adaptec drivers SCSIHA.SYS and AHA1540.SYS included
  136.     both 386 and disk buffering options invoked by the parameters
  137.     "/v386" and "/b:64." "/v386" stands for virtual 386; "/b:64"
  138.     allocates a 64k buffer, for DMA.
  139.  
  140.     Unlike the drivers in (1) above, these drivers do not provide
  141.     VDS services. If you are using a driver such as this, make sure
  142.     that it is not loaded high. The purpose of such a driver is to
  143.     provide buffering into physical addresses that are the same as
  144.     logical addresses; if the program is loaded high, its buffer
  145.     will be in logical addresses that are not the same as their
  146.     physical addresses. Please read the section below titled
  147.     "Making Sure Your Device Driver Loads Low".
  148.  
  149.  4) Check the documentation for your bus-mastering device and see
  150.     if it can be configured to use the BIOS or any one of the
  151.     standard DMA channels. QEMM can correct the problem if the BIOS
  152.     or standard DMA channels are used.
  153.  
  154.  5) As mentioned above, bus-mastering hard drives can also cause
  155.     problems for Microsoft Windows 3. Microsoft's solution is in
  156.     its SmartDrive disk cache. SMARTDRV (and other disk caches)
  157.     contain code that can buffer direct memory access. Before QEMM
  158.     7.03, QEMM's VDS services were almost completely disabled when
  159.     you entered Enhanced mode, so SMARTDRV's buffering was needed
  160.     to ensure that no bus-mastering conflicts occured inside of
  161.     Microsoft Windows. If you are using QEMM 7.5 or later, QEMM's
  162.     VDS services and disk buffering will function properly while
  163.     Microsoft Windows Enhanced mode is running, so loading SMARTDRV
  164.     is not necessary.
  165.  
  166.     a) The versions of Smartdrv that ship with Microsoft Windows
  167.        3.1, DOS 5, and DOS 6 have two functions: to provide disk
  168.        caching through a module loaded in AUTOEXEC.BAT, and to
  169.        provide buffering for SCSI hard drives through a module
  170.        loaded in CONFIG.SYS. If you are using Windows 3.1 AND a
  171.        bus-mastering hard drive and you are NOT using any of the
  172.        options numbered 1 through 4 above, make sure that the
  173.        following line appears in CONFIG.SYS:
  174.  
  175.        DEVICE=C:\WINDOWS\SMARTDRV.EXE /DOUBLE_BUFFER
  176.  
  177.        (If your path to SmartDrive differs, change C:\WINDOWS to
  178.        the correct path.) Please read the section below titled
  179.        "Making Sure Your Device Driver Loads Low".
  180.  
  181.     b) Windows 3.0 and DOS 5 shipped with SmartDrive version 3 or
  182.        lower. If you are using one of these versions of SmartDrive,
  183.        make sure that the following line appears in your CONFIG.SYS
  184.        file:
  185.  
  186.        DEVICE=C:\WINDOWS\SMARTDRV.SYS
  187.  
  188.        (If your path to SmartDrive differs, change C:\WINDOWS to
  189.        the correct path.)
  190.  
  191.        Please read the section below titled "Making Sure Your
  192.        Device Driver Loads Low".
  193.  
  194.  6) QEMM has a DB=xx (DISKBUF=xx) parameter that can prevent
  195.     QEMM-SCSI problems at the expense of a little conventional
  196.     memory. "xx" is the number of K used for buffering. Any value
  197.     for xx is sufficient to correct the problem. DISKBUF=2 is fine
  198.     for most cases. Configuring QEMM with a DISKBUF greater than 2
  199.     might improve disk performance, but setting DISKBUF to more
  200.     than 10 is probably a waste of memory.
  201.  
  202.  Q. How does QEMM's detection of bus-mastering hard drives work?
  203.  
  204.  A. QEMM will detect a bus-mastering hard drive and create a disk
  205.     buffer automatically as long as QEMM itself is loaded from that
  206.     bus-mastering hard drive. If you load a driver that provides
  207.     VDS (Virtual DMA Services) support BEFORE you load QEMM, QEMM
  208.     will not create the disk buffer. In cases where QEMM
  209.     automatically creates this buffer, it does not add a DISKBUF
  210.     parameter to the QEMM386.SYS line. QEMM's automatic detection
  211.     of bus-mastering hard disks is active only when the RAM
  212.     parameter is specified on the QEMM386.SYS line in the
  213.     CONFIG.SYS file. You can disable QEMM's automatic disk
  214.     buffering by using the QEMM386.SYS parameters DISKBUF=0, but
  215.     there is usually no reason to disable this feature. If you have
  216.     a bus-mastering hard disk that you do not load QEMM from, QEMM
  217.     will not detect bus-mastering conflicts with it, and you must
  218.     either use the disk controller's VDS support or specify the
  219.     DISKBUF=nn (DB=nn).
  220.  
  221.     Use of the DB= parameter will not help if the bus-mastering
  222.     device is something other than a hard disk. If your
  223.     bus-mastering device is not a hard disk then the solutions
  224.     above, especially #1, are your only options.
  225.  
  226.     If your bus-mastering hard disk controller uses a VDS device
  227.     driver that is loaded after QEMM386.SYS, QEMM will still create
  228.     a 2K disk buffer, because the VDS support will not be active
  229.     when QEMM loads. This disk buffer will be necessary in most
  230.     circumstances, because the Optimize program would otherwise
  231.     fail when it tried to load the VDS driver into High RAM.
  232.     However, you may wish in this circumstance to reduce the size
  233.     of the disk buffer as much as possible by placing the DISKBUF=1
  234.     parameter on the QEMM386.SYS device driver line. The smaller
  235.     disk buffer is preferable here, because the disk buffer will
  236.     never again be used after the VDS driver loads, and a bigger
  237.     disk buffer uses valuable conventional memory.
  238.  
  239.     If you are both disabling automatic disk buffering (with the
  240.     DISKBUF=0 parameter) and creating a disk buffer for the page
  241.     frame (with the DISKBUFFRAME=xx parameter), you must place the
  242.     DISKBUF=0 parameter before the DISKBUFFRAME=xx parameter on the
  243.     QEMM386.SYS line in the CONFIG.SYS file. If you reverse this
  244.     ordering, automatic disk buffering will still be disabled, but
  245.     the disk buffer for the page frame will not be created.
  246.  
  247.  Q. I don't have a VDS driver, and I think that my proprietary
  248.     device driver or my disk cache should be loaded low. How do I
  249.     prevent it from loading high?
  250.  
  251.  A. For double-buffering to work properly, the device driver for
  252.     your bus-mastering hardware must be loaded in conventional
  253.     memory, where physical and logical addresses are almost always
  254.     the same. You must therefore make sure that it loads low if you
  255.     are depending on it to provide DMA buffering. We will use
  256.     SMARTDRV as an example of such a program. Change the
  257.     instructions below to fit your device driver.
  258.  
  259.     Ensure that there is no LOADHI command preceding SMARTDRV on
  260.     the line which loads it.
  261.  
  262.     OPTIMIZE will very likely try to load SmartDrive high, unless
  263.     you instruct it not to do so. This is most easily done as
  264.     follows:
  265.  
  266.     1) Using a text editor, create a text file called OPTIMIZE.NOT
  267.        in the \QEMM directory. Systems with DOS 5 and later can
  268.        type "EDIT OPTIMIZE.NOT" from the \QEMM directory to create
  269.        the file. If such a file exists already, simply open it for
  270.        editing.
  271.  
  272.     2) Put a new line in OPTIMIZE.NOT that says:
  273.  
  274.        SMARTDRV
  275.  
  276.        Do not specify a pathname nor an extension to the file name.
  277.        Save the file and exit the editor.
  278.  
  279.     3) From now on, OPTIMIZE will not affect the SMARTDRV line in
  280.        either CONFIG.SYS or AUTOEXEC.BAT. As long as SMARTDRV is
  281.        not being loaded high already, it will not load high during
  282.        future OPTIMIZE sessions.
  283.  
  284.  Q. I know I have a bus-mastering device on my computer, but I
  285.     haven't seen any problem. Why not?
  286.  
  287.  A. It's possible that your bus-mastering device uses a standard
  288.     DMA channel for DMA operations. QEMM automatically supports
  289.     bus-mastering when standard DMA channels are used.
  290.  
  291.     Your bus-mastering device may have been shipped with a VDS
  292.     driver in its ROM. Some bus-mastering hard disk controllers
  293.     ship with drivers that make VDS calls, and these drivers do not
  294.     require the DB parameter or any other buffering. We expect that
  295.     most bus-mastering devices will eventually include VDS drivers
  296.     and, therefore, will not exhibit any problems when run in
  297.     Virtual 86 mode.
  298.  
  299.  ******************************************************************
  300.  *      Trademarks are property of their respective owners.       *
  301.  *   This and other technical notes may be available in updated   *
  302.  *     forms through Quarterdeck's standard support channels.     *
  303.  *          Copyright (C) 1995 Quarterdeck Corporation            *
  304.  ******************** E N D   O F   F I L E ***********************
  305.